import { createApp } from 'vue'
import App from './App.vue'
import router from './router'

let app = null

const render = () => {
  app = createApp(App)
  app.use(router).mount('#appv3')
}

// 当前环境不是微前端环境
if (!window.__POWERED_BY_QIANKUN__) {
  render()
}

// 开始的声明周期
export const bootstrap = async () => {
  console.log('bootstrap', 'vue3')
}

export const mount = async () => {
  render()
  console.log('mount', 'vue3')
  // window.custom.on('test1', data => {
  //   console.log('test1 监听回调', data)
  // })
}

export const unmount = async () => {
  console.log('unmount', 'vue3')
  console.log('window.testName', window.testName)
}
